﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NextCMS.Models;

public partial class TopFixedMenu : System.Web.UI.UserControl
{
    public string fileName = "";
    public string siteName = "";
    public string Mode = "";
    public int FrontSiteId { get; set; }
    public int UserLanguageId { get; set; }
    public bool IsLayoutMode { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
        fileName = Convert.ToString(Page.RouteData.Values["fileName"]);
        siteName = Convert.ToString(Page.RouteData.Values["SiteName"]);
        if (!String.IsNullOrEmpty(siteName))
            siteName = siteName+"/";
        if (IsLayoutMode)
            Mode = "Layout_";
        using (SiteLanguagesHelper helper = new SiteLanguagesHelper())
        {

            SiteLanguageModel SiteLanguage = helper.GetById(UserLanguageId);
            if (SiteLanguage != null)
                ltrLanguage.Text = SiteLanguage.LangName;
            IEnumerable<SiteLanguageModel> lstSiteLanguages = helper.GetAllBySiteId(FrontSiteId);
            RPTLanguages.DataSource = lstSiteLanguages;
            RPTLanguages.DataBind();
        }
    }
}